<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of BlogTwigExtensions
 *
 * @author bien.tran
 */
namespace Blog\BlogBundle\Twig\Extensions;

class BlogTwigExtensions extends \Twig_Extension{
    
    public function getName() {
        return 'blog_twig_extension';
    }
    public function getFunctions() {
        return array(
            'blog_replace' => new \Twig_Function_Method($this, 'replace_Text'));
    }
    public function replace_Text($str_to_replace) {
        
        $temp = array('1' => '0', ' ' => '-', '+' => '*');
        return strtr($str_to_replace, $temp);
    }
}

?>
